

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>cortex package &mdash; Cortex2.0  documentation</title>
  

  
  
  
  

  

  
  
    

  

  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="cortex.built_ins package" href="cortex.built_ins.html" />
    <link rel="prev" title="cortex" href="modules.html" /> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="index.html" class="icon icon-home"> Cortex2.0
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">User Documentation</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">cortex</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">cortex package</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#subpackages">Subpackages</a><ul>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.html">cortex.built_ins package</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#submodules">Submodules</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-cortex.main">cortex.main module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-cortex.plugins">cortex.plugins module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-cortex">Module contents</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="develop.html">Develop</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Custom demos</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html#a-walkthrough-a-custom-classifier">A walkthrough a custom classifier:</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html#defining-losses-and-results">Defining losses and results</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html#visualization">Visualization</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html#putting-it-together">Putting it together</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">Cortex2.0</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="index.html">Docs</a> &raquo;</li>
        
          <li><a href="modules.html">cortex</a> &raquo;</li>
        
      <li>cortex package</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="_sources/cortex.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="cortex-package">
<h1>cortex package<a class="headerlink" href="#cortex-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="subpackages">
<h2>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="cortex.built_ins.html">cortex.built_ins package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="cortex.built_ins.html#subpackages">Subpackages</a><ul>
<li class="toctree-l3"><a class="reference internal" href="cortex.built_ins.datasets.html">cortex.built_ins.datasets package</a><ul>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.datasets.html#submodules">Submodules</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.datasets.html#module-cortex.built_ins.datasets.CelebA">cortex.built_ins.datasets.CelebA module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.datasets.html#cortex-built-ins-datasets-dsprites-module">cortex.built_ins.datasets.dSprites module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.datasets.html#module-cortex.built_ins.datasets.imagenet">cortex.built_ins.datasets.imagenet module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.datasets.html#module-cortex.built_ins.datasets.nii_dataload">cortex.built_ins.datasets.nii_dataload module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.datasets.html#module-cortex.built_ins.datasets.torchvision_datasets">cortex.built_ins.datasets.torchvision_datasets module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.datasets.html#module-cortex.built_ins.datasets.toysets">cortex.built_ins.datasets.toysets module</a><ul>
<li class="toctree-l5"><a class="reference internal" href="cortex.built_ins.datasets.html#todos">TODOs</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.datasets.html#module-cortex.built_ins.datasets.utils">cortex.built_ins.datasets.utils module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.datasets.html#module-cortex.built_ins.datasets">Module contents</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="cortex.built_ins.models.html">cortex.built_ins.models package</a><ul>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.models.html#submodules">Submodules</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.models.html#module-cortex.built_ins.models.adversarial_autoencoder">cortex.built_ins.models.adversarial_autoencoder module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.models.html#module-cortex.built_ins.models.ae">cortex.built_ins.models.ae module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.models.html#module-cortex.built_ins.models.ali">cortex.built_ins.models.ali module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.models.html#module-cortex.built_ins.models.classifier">cortex.built_ins.models.classifier module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.models.html#cortex-built-ins-models-discrete-gan-module">cortex.built_ins.models.discrete_gan module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.models.html#module-cortex.built_ins.models.gan">cortex.built_ins.models.gan module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.models.html#module-cortex.built_ins.models.image_coders">cortex.built_ins.models.image_coders module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.models.html#module-cortex.built_ins.models.mine">cortex.built_ins.models.mine module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.models.html#module-cortex.built_ins.models.utils">cortex.built_ins.models.utils module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.models.html#module-cortex.built_ins.models.vae">cortex.built_ins.models.vae module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.models.html#module-cortex.built_ins.models">Module contents</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="cortex.built_ins.networks.html">cortex.built_ins.networks package</a><ul>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.networks.html#submodules">Submodules</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.networks.html#module-cortex.built_ins.networks.SpectralNormLayer">cortex.built_ins.networks.SpectralNormLayer module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.networks.html#module-cortex.built_ins.networks.ae_network">cortex.built_ins.networks.ae_network module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.networks.html#module-cortex.built_ins.networks.base_network">cortex.built_ins.networks.base_network module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.networks.html#module-cortex.built_ins.networks.conv_decoders">cortex.built_ins.networks.conv_decoders module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.networks.html#module-cortex.built_ins.networks.convnets">cortex.built_ins.networks.convnets module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.networks.html#module-cortex.built_ins.networks.fully_connected">cortex.built_ins.networks.fully_connected module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.networks.html#module-cortex.built_ins.networks.modules">cortex.built_ins.networks.modules module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.networks.html#module-cortex.built_ins.networks.resnets">cortex.built_ins.networks.resnets module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.networks.html#module-cortex.built_ins.networks.tv_models_wrapper">cortex.built_ins.networks.tv_models_wrapper module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.networks.html#module-cortex.built_ins.networks.utils">cortex.built_ins.networks.utils module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.networks.html#module-cortex.built_ins.networks">Module contents</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="cortex.built_ins.transforms.html">cortex.built_ins.transforms package</a><ul>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.transforms.html#submodules">Submodules</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.transforms.html#module-cortex.built_ins.transforms.sobel">cortex.built_ins.transforms.sobel module</a></li>
<li class="toctree-l4"><a class="reference internal" href="cortex.built_ins.transforms.html#module-cortex.built_ins.transforms">Module contents</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="cortex.built_ins.html#module-cortex.built_ins">Module contents</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-cortex.main">
<span id="cortex-main-module"></span><h2>cortex.main module<a class="headerlink" href="#module-cortex.main" title="Permalink to this headline">¶</a></h2>
<p>Main file for running experiments.</p>
<dl class="function">
<dt id="cortex.main.run">
<code class="descclassname">cortex.main.</code><code class="descname">run</code><span class="sig-paren">(</span><em>model=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/main.html#run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.main.run" title="Permalink to this definition">¶</a></dt>
<dd><p>Main function.</p>
</dd></dl>

</div>
<div class="section" id="module-cortex.plugins">
<span id="cortex-plugins-module"></span><h2>cortex.plugins module<a class="headerlink" href="#module-cortex.plugins" title="Permalink to this headline">¶</a></h2>
<p>Module for plugins</p>
<dl class="class">
<dt id="cortex.plugins.DatasetPlugin">
<em class="property">class </em><code class="descclassname">cortex.plugins.</code><code class="descname">DatasetPlugin</code><a class="reference internal" href="_modules/cortex/plugins.html#DatasetPlugin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.DatasetPlugin" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex._lib.data.DatasetPluginBase</span></code></p>
<p>Basic plugin class for datasets into cortex</p>
<dl class="attribute">
<dt id="cortex.plugins.DatasetPlugin.sources">
<code class="descname">sources</code><a class="headerlink" href="#cortex.plugins.DatasetPlugin.sources" title="Permalink to this definition">¶</a></dt>
<dd><p>list of dataset string names that this plugin will support.</p>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.DatasetPlugin.add_dataset">
<code class="descname">add_dataset</code><span class="sig-paren">(</span><em>mode: str</em>, <em>dataset: torch.utils.data.dataset.Dataset</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#DatasetPlugin.add_dataset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.DatasetPlugin.add_dataset" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a dataset to the plugin.</p>
<p>Any dataset added in this way will be used in the training or testing
loops, depending on the mode specified.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>mode</strong> – The data mode that this dataset will be run on.
<cite>train</cite> and <cite>test</cite> are highly recommended.</li>
<li><strong>dataset</strong> – The dataset object.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.DatasetPlugin.copy_to_local_path">
<code class="descname">copy_to_local_path</code><span class="sig-paren">(</span><em>from_path: str</em><span class="sig-paren">)</span> &#x2192; str<a class="reference internal" href="_modules/cortex/plugins.html#DatasetPlugin.copy_to_local_path"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.DatasetPlugin.copy_to_local_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Copies data to a local path.</p>
<p>Path is set in the .cortex.yml file. This can be set up through
<cite>cortex setup</cite>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>from_path</strong> – The path to the data to be copied.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.DatasetPlugin.get_path">
<code class="descname">get_path</code><span class="sig-paren">(</span><em>source: str</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#DatasetPlugin.get_path"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.DatasetPlugin.get_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Get’s the path to a source.</p>
<p>This is derived from config.yaml file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>source</strong> – str for the dataset source.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The path to the dataset.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.DatasetPlugin.make_indexing">
<code class="descname">make_indexing</code><span class="sig-paren">(</span><em>C</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#DatasetPlugin.make_indexing"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.DatasetPlugin.make_indexing" title="Permalink to this definition">¶</a></dt>
<dd><p>Makes an indexing dataset.</p>
<p>Index comes in as the last element of the batch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>C</strong> – data.Dataset class.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Wrapped data.Dataset class.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.DatasetPlugin.set_dims">
<code class="descname">set_dims</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#DatasetPlugin.set_dims"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.DatasetPlugin.set_dims" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the dimenisions of the data</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>**kwargs</strong> – a dictionary of dimension keys and ints.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.DatasetPlugin.set_input_names">
<code class="descname">set_input_names</code><span class="sig-paren">(</span><em>input_names</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#DatasetPlugin.set_input_names"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.DatasetPlugin.set_input_names" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the names of the elements of the dataset.</p>
<p>For use downstream in models.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>input_names</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">list</span></code></a> of <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">str</span></code></a>) – The input names.
Should be the same size as the output of the dataset iterator.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.DatasetPlugin.set_scale">
<code class="descname">set_scale</code><span class="sig-paren">(</span><em>scale</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#DatasetPlugin.set_scale"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.DatasetPlugin.set_scale" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the min / max values for the data.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This will probably be removed. It doesn’t even function right now.</p>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>scale</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.7)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tuple</span></code></a> of <a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.7)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">float</span></code></a>) – min/max pair.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt>
<code class="descname">sources</code><em class="property"> = []</em></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.plugins.ModelPlugin">
<em class="property">class </em><code class="descclassname">cortex.plugins.</code><code class="descname">ModelPlugin</code><span class="sig-paren">(</span><em>contract=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex._lib.models.ModelPluginBase</span></code></p>
<p>Module plugin.</p>
<dl class="attribute">
<dt id="cortex.plugins.ModelPlugin.plugin_name">
<code class="descname">plugin_name</code><a class="headerlink" href="#cortex.plugins.ModelPlugin.plugin_name" title="Permalink to this definition">¶</a></dt>
<dd><p><em>str</em> – Name of the plugin.</p>
</dd></dl>

<dl class="attribute">
<dt id="cortex.plugins.ModelPlugin.data_defaults">
<code class="descname">data_defaults</code><a class="headerlink" href="#cortex.plugins.ModelPlugin.data_defaults" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">dict</span></code></a> – Data defaults.</p>
</dd></dl>

<dl class="attribute">
<dt id="cortex.plugins.ModelPlugin.train_defaults">
<code class="descname">train_defaults</code><a class="headerlink" href="#cortex.plugins.ModelPlugin.train_defaults" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">dict</span></code></a> – Train defaults.</p>
</dd></dl>

<dl class="attribute">
<dt id="cortex.plugins.ModelPlugin.optimizer_defaults">
<code class="descname">optimizer_defaults</code><a class="headerlink" href="#cortex.plugins.ModelPlugin.optimizer_defaults" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">dict</span></code></a> – Optimizer defaults.</p>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.ModelPlugin.add_histogram">
<code class="descname">add_histogram</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin.add_histogram"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin.add_histogram" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds histogram for visualizaiton.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>*args</strong> – TODO</li>
<li><strong>**kwargs</strong> – TODO</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.ModelPlugin.add_image">
<code class="descname">add_image</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin.add_image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin.add_image" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds image for visualization.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>*args</strong> – TODO</li>
<li><strong>**kwargs</strong> – TODO</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.ModelPlugin.add_noise">
<code class="descname">add_noise</code><span class="sig-paren">(</span><em>key</em>, <em>dist=None</em>, <em>size=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin.add_noise"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin.add_noise" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a noise variable to the model.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Name of the noise variable.</li>
<li><strong>dist</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Noise distribution.</li>
<li><strong>size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – Size of the noise.</li>
<li><strong>**kwargs</strong> – keyword arguments for noise distribution.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.ModelPlugin.add_scatter">
<code class="descname">add_scatter</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin.add_scatter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin.add_scatter" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a scatter plot to visualization.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>*args</strong> – TODO</li>
<li><strong>**kwargs</strong> – TODO</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.ModelPlugin.build">
<code class="descname">build</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin.build"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin.build" title="Permalink to this definition">¶</a></dt>
<dd><p>Builds the neural networks.</p>
<p>The the model is to build something, this needs to be overridden.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>*args</strong> – Inputs to be passed to the function.</li>
<li><strong>**kwargs</strong> – Hyperparameters to be passed to the function</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="cortex.plugins.ModelPlugin.defaults">
<code class="descname">defaults</code><em class="property"> = {}</em><a class="headerlink" href="#cortex.plugins.ModelPlugin.defaults" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="cortex.plugins.ModelPlugin.eval_loop">
<code class="descname">eval_loop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin.eval_loop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin.eval_loop" title="Permalink to this definition">¶</a></dt>
<dd><p>The evaluation loop.</p>
<p>This can be overridden to change the behavior of the evaluation loop.</p>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.ModelPlugin.eval_step">
<code class="descname">eval_step</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin.eval_step"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin.eval_step" title="Permalink to this definition">¶</a></dt>
<dd><p>Makes an evaluation step.</p>
<p>This can be overridden to change the behavior of each evaluation step.</p>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.ModelPlugin.get_dims">
<code class="descname">get_dims</code><span class="sig-paren">(</span><em>*queries</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin.get_dims"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin.get_dims" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets dimensions of inputs.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>*queries</strong> – Variables to get dimensions of .</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Dimensions of the variables.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.ModelPlugin.optimizer_step">
<code class="descname">optimizer_step</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin.optimizer_step"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin.optimizer_step" title="Permalink to this definition">¶</a></dt>
<dd><p>Makes a step of the optimizers for which losses are defined.</p>
<p>This can be overridden to change the behavior of the optimizer.</p>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.ModelPlugin.routine">
<code class="descname">routine</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin.routine"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin.routine" title="Permalink to this definition">¶</a></dt>
<dd><p>Derives losses and results.</p>
<p>The the model is to train something, this needs to be
overridden.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>*args</strong> – Inputs to be passed to the function.</li>
<li><strong>**kwargs</strong> – Hyperparameters to be passed to the function</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.ModelPlugin.train_loop">
<code class="descname">train_loop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin.train_loop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin.train_loop" title="Permalink to this definition">¶</a></dt>
<dd><p>The training loop.</p>
<p>This can be overridden to change the behavior of the training loop.</p>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.ModelPlugin.train_step">
<code class="descname">train_step</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin.train_step"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin.train_step" title="Permalink to this definition">¶</a></dt>
<dd><p>Makes a training step.</p>
<p>This can be overridden to change the behavior at each training step.</p>
</dd></dl>

<dl class="method">
<dt id="cortex.plugins.ModelPlugin.visualize">
<code class="descname">visualize</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#ModelPlugin.visualize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.ModelPlugin.visualize" title="Permalink to this definition">¶</a></dt>
<dd><p>Visualizes.</p>
<p>The the model is to visualize something, this needs to be
overridden.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>*args</strong> – Inputs to be passed to the function.</li>
<li><strong>**kwargs</strong> – Hyperparameters to be passed to the function</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="cortex.plugins.register_plugin">
<code class="descclassname">cortex.plugins.</code><code class="descname">register_plugin</code><span class="sig-paren">(</span><em>plugin</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/plugins.html#register_plugin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.plugins.register_plugin" title="Permalink to this definition">¶</a></dt>
<dd><p>Registers a plugin into cortex</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>plugin</strong> – TODO</td>
</tr>
</tbody>
</table>
<p>Returns:</p>
</dd></dl>

</div>
<div class="section" id="module-cortex">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-cortex" title="Permalink to this headline">¶</a></h2>
<p>Init file for cortex.</p>
</div>
</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="cortex.built_ins.html" class="btn btn-neutral float-right" title="cortex.built_ins package" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="modules.html" class="btn btn-neutral" title="cortex" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2018, MILA.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'',
            LANGUAGE:'None',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: '.txt'
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

  

  <script type="text/javascript" src="_static/js/theme.js"></script>

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>